package chapter04.demo1;
class Animal5{
    String name = "牧羊犬";
    //    定义动物叫的方法
    void shout(){
        System.out.println("动物发出叫声");
    }
}
//定义Dog类继承Animal类
class Dog5 extends Animal5{
    public void shout(){
        super.shout();
        System.out.println("汪汪汪");
    }
    public void printName(){
        System.out.println("名字："+super.name);
    }
}
public class Example05 {
    public static void main(String[] args) {
        Dog5 dog = new Dog5();
        dog.shout();
        dog.printName();
    }
}